var user = require('./userRoute');
var plan = require('./planRoute');
var planDetail = require('./planRoute/detail');
var planExtra = require('./planRoute/extraInfo');
var project = require('./projectRoute');
var member = require('./userRoute/member');
var team = require('./userRoute/team');

module.exports = function (app) {

    app.get('/', user.loginPage);
    app.get('/user/mapping' , user.getMapping);
    app.post('/setting/update', user.updateSetting);
    app.post('/login' , user.login);
    app.get('/logout' , user.logout);
    app.get('/modifyPwd' , user.modifyPwdPage);
    app.post('/modifyPwd' , user.modifyPassword);
    app.post('/user/fire' , user.leaveTeam);
    app.post('/validate/unique' , user.validateUnique);

    app.get('/project/find', project.findProjectPage);
    app.post('/project/find', project.findProjects);
    app.post('/project/findAll', project.findAllProjects);
    app.post('/project/delete', project.deleteProjects);
    app.get('/project/multiAdd', project.addProjectPage);
    app.get('/project/add', project.singleAddProjectPage);
    app.post('/project/add', project.addProject);
    app.get('/project/batchUpdate', project.pmEditProjectPage);
    app.get('/project/update/:id', project.editProjectPage);
    app.post('/project/save',project.saveProjects);
    app.post('/project/upload',project.uploadForm);

    app.get('/member/find', member.findMemberPage);
    app.post('/member/find', member.findMembers);
    app.post('/member/delete', member.deleteMembers);
    app.get('/member/multiAdd', member.addMemberPage);
    app.get('/member/add', member.singleAddMemberPage);
    app.post('/member/add', member.addMember);
    app.get('/member/update/:id', member.editMemberPage);
    app.post('/member/save',member.saveMembers);
    app.post('/member/upload',member.uploadForm);

    app.get('/plan/find', plan.findPlanPage);
    app.get('/plan/add', plan.addPlanPage);
    app.get('/plan/input', plan.inputPlanPage);
    app.get('/plan/export/:id', plan.exportDoc);
    app.get('/plan/list', plan.planListPage);
    app.post('/plan/find', plan.findPlans);
    app.post('/plan/findList', plan.findPlanList);
    app.post('/plan/edit', plan.editPlan);
    app.post('/plan/add', plan.addPlan);

    app.post('/plan/detail/findGroup', planDetail.findPlanDetailGroup);
    app.post('/plan/detail/find', planDetail.findPlanDetail);
    app.post('/plan/detail/add', planDetail.addPlanDetail);

    app.post('/plan/extra/find', planExtra.findPlanExtra);
    app.post('/plan/extra/add', planExtra.addPlanExtra);

    app.get('/team/find', team.managerTeamPage);
    app.post('/team/update', team.updateTeam);
    app.post('/team/add', team.addNewTeam);
    app.post('/team/update/leader', team.updateTeamWithLeader);
    app.post('/team/addMember', team.addTeamMember);
    app.post('/team/delete', team.deleteTeam);
};
